window.onload=function (){

  var nav=  document.getElementById('nav');

  var listItems= nav.children;

    for (var i = 0; i <listItems.length ; i++) {

        listItems[i].onclick=function (){

          if(this.children[0].style.display=='none'){
              this.children[0].style.display='block'
          }else {
              this.children[0].style.display='none'
          }





        }
    }

}